/*
 * 
 * Name: 		Paul Byrne
 * Student No:	C00130348
 * Project:		Please Sleep Here
 * Date:		April 2013
 * 
 * Class:		BooleanConversion
 * 
 * Purpose:
 * This class is responsible for converting booleans to the string
 * yes or no
 * and to convert the string back to a boolean
 * 
 * 
 */
package ie.live.byrnep.pleasesleephere.base;

import ie.live.byrnep.pleasesleephere.R;
import android.content.Context;

public class BooleanConversion {

	private  String YES;
	private  String NO;
	
	public BooleanConversion(Context c){
		this.YES = c.getString(R.string.display_yes);
		this.NO = c.getString(R.string.display_no);
	}
	
	public String convertFromBool(final String check){
		if (Boolean.parseBoolean(check))
			return YES;
		return NO;
	}
	public Boolean convertToBool(final String check){
		if (YES == check)
			return true;
		return false;
	}
}
